package alg

import (
	"golang.org/x/exp/rand"
	"time"
)

// 生成随机数
func GenRandomId(length int) string {
	rand.Seed(uint64(time.Now().UnixNano()))
	result := make([]byte, length)
	digits := "0123456789"
	for i := range length {
		result[i] = digits[rand.Intn(len(digits))]
	}
	return string(result)
}
